package cn.hiapi.shopkeeper.entity.order;

import cn.hiapi.basic.entity.BasicEntity;
import cn.hiapi.basic.serializer.LongToStringSerializer;
import cn.hiapi.shopkeeper.enums.ActivityType;
import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.math.BigDecimal;

/**
 * @author AdinZ
 * @date 2023/1/10 10:10
 */
@Entity
@Table(name = "hiapi_shopkeeper_activity_invite_record")
@ApiModel(description = "邀请记录")
@Getter
@Setter
public class ActivityInviteRecord extends BasicEntity {
    @Id
    @GeneratedValue(generator = "snowflake")
    @GenericGenerator(name = "snowflake", strategy = "cn.hiapi.basic.id.SnowflakeId")
    @JSONField(serializeUsing = LongToStringSerializer.class)
    private Long id;

    @ApiModelProperty("邀请人,权益拥有者")
    private long inviteUid;

    @ApiModelProperty("被邀请人")
    private long uid;

    @ApiModelProperty("店铺id")
    private long shopId;

    @ApiModelProperty("活动id")
    private long aid;

    @ApiModelProperty("活动id")
    @Enumerated(EnumType.STRING)
    private ActivityType type;


    /**
     * 邀请金额
     */
    @Column(columnDefinition = "decimal(10,2)")
    private BigDecimal shareAmount = BigDecimal.ZERO;
    private String remark;

    @ApiModelProperty("状态 0未奖励 1已奖励")
    private int status;

    private int shareAward;

    @ApiModelProperty("新客赠送 1赠送")
    private int newGift;

    @ApiModelProperty("创建时间")
    private long created = System.currentTimeMillis();

    @ApiModelProperty("更新时间")
    private long updated = System.currentTimeMillis();


}
